package com.atguigu.gmall.product;

import org.csource.common.MyException;
import org.csource.fastdfs.ClientGlobal;
import org.csource.fastdfs.StorageClient1;
import org.csource.fastdfs.TrackerClient;
import org.csource.fastdfs.TrackerServer;



/**
 * @author gsy
 * @date 2021年08月25日22:30
 * Description
 */

public class FastDemo {
    public static void main(String[] args) throws Exception {
        String path = FastDemo.class.getClassLoader().getResource("fdfs_client.conf").getPath();
        ClientGlobal.init(path);
        //跟踪器的客户端
        TrackerClient trackerClient = new TrackerClient();

        //获取存储节点的IP和port
        TrackerServer trackerServer = trackerClient.getConnection();
        StorageClient1 storageClient1 = new StorageClient1(trackerServer,null);
        String fileId = storageClient1.upload_file1("D:\\developer_tools\\2.jpg",
                "jpg", null);
        System.out.println(fileId);

    }
}
